//
// Description: 104. 二叉树的最大深度
// Created by Loading on 2025/5/27.
//

#include <bits/stdc++.h>
#include <Utils.h>

using namespace std;

int maxDepth(TreeNode *root) {
    if (!root) {
        return 0;
    }

    return max(maxDepth(root->left), maxDepth(root->right)) + 1;
}

int main() {
    auto root = generateTreeNode({3, 9, 20, -1, -1, 15, 7});

    auto res = maxDepth(root);

    cout << res << endl;

    return 0;
}
